package net.wwang.blog.controller.portal;

import net.wwang.blog.pojo.Comment;
import net.wwang.blog.commons.global.ResponseResult;
import net.wwang.blog.service.CommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @author WangWei
 * @date 2020/8/14
 */
@RestController
@RequestMapping("/portal/comment")
public class CommentPortalApi {
    @Autowired
    private CommentService commentService;

    @PostMapping
    public ResponseResult addComment(@RequestBody Comment comment, HttpServletRequest request, HttpServletResponse response){
        return commentService.addComment(comment, request, response);
    }

    @DeleteMapping("/{commentId}")
    public ResponseResult delComment(@PathVariable("commentId") String commentId ){
        return null;
    }

    @GetMapping("/list/{articleId}")
    public  ResponseResult getComentList(@PathVariable("articleId")String articleId){
        return  null;
    }
}
